﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MessageList.aspx.cs" Inherits="Com.CMS263.Web.manage.MessageManage.MessageList" %>
<%@ Import Namespace="Com.CMS263.Util" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>留言管理</title>
    <link href="/manage/css/common.css" rel="stylesheet" type="text/css" />
    <link href="/manage/css/main.css" rel="stylesheet" type="text/css" />
    <link href="/manage/css/box.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" language="javascript" src="/manage/js/jquery-1.4.2.min.js"></script>

    <script type="text/javascript" language="javascript" src="/manage/js/pager.js"></script>

    <script language="javascript" type="text/javascript">
        function del(id, obj) {
            if (confirm('这是一个不可逆的操作，真的要删除此条记录')) {
                $.post("action.aspx", { id: id }, function(data) {
                    if (data == "ok") {
                        alert('删除成功');
                        $(obj.parentNode.parentNode).remove();
                    }
                })
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server" action="MessageList.aspx" enctype="multipart/form-data">
    <div class="main">
        <div class="mainMenu">
            <div class="mainMenuList">
                <ul>
                    <li class="s"><a><b>在线交流</b><span></span></a></li>
                </ul>
            </div>
        </div>
        <div class="mainContent">
            <div class="productList">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table2">
                    <tr>
                        <th class="c" width="40">
                            编号
                        </th>
                        <th class="c">
                            姓名
                        </th>
                        <th class="c">
                            留言
                        </th>
                        <th class="c">
                            提交时间
                        </th>
                        
                        <th class="c">
                            状态
                        </th>
                        <th class="c">
                            操作
                        </th>
                    </tr>
                    <% foreach (Com.CMS263.PO.Message mes in meslist)
                       { %>
                    <tr>
                        <td class="c">
                            <%=mes.Id %>
                        </td>
                        <td class="c">
                            <%=mes.UserName%>
                        </td>
                        <td class="c">
                            <%=StringUtil.GetText(mes.Contents,30)%>
                        </td>
                        <td class="c">
                            <%=mes.AddDate.ToString("yyyy-MM-dd HH:mm:ss") %>
                        </td>
                       
                        <td class="c">
                            <%=mes.IsRead==false?"未读":"<span style='color:red'>已读</span>" %>&nbsp;&nbsp;&nbsp;&nbsp;<%=mes.IsReply==false?"未回复":"<span style='color:red'>已回复</span>" %>
                        </td>
                        <td class="c">
                            <a href="MessageShow.aspx?id=<%=mes.Id %>&page=<%=Request["page"] %>">查看</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <a style="cursor: pointer" onclick="del(<%=mes.Id %>,this)">删除</a>
                        </td>
                    </tr>
                    <%} %>
                    <tr>
                        <td colspan="8">
                            <div style="float: right; margin-right: 100px">
                                <%=GetPager()%></div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
